package com.fanshuai.lifecycle.aware;

import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.stereotype.Component;

/**
 * 获取ClassLoader
 */
@Component
public class DemoClassLoader implements BeanClassLoaderAware {
    private ClassLoader classLoader;

    @Override
    public void setBeanClassLoader(ClassLoader classLoader) {
        this.classLoader = classLoader;
        System.out.println("classloader=" + this.classLoader.toString());
    }

    public ClassLoader getClassLoader() {
        return classLoader;
    }
}
